﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;
using YJKRevitKernel.XYZUtility;

namespace YJKRevitDimensionText.VerticalAutoDim.OutWallSearch
{
	internal class OutWallDataEqualityComparer : IEqualityComparer<OutWallData>
	{
		public bool Equals(OutWallData x, OutWallData y)
		{
			if (string.Compare(x.Element.UniqueId, y.Element.UniqueId) == 0)
			{
				XYZ xyz = x.Curve.Evaluate(0.5, true);
				XYZ xyz2 = y.Curve.Evaluate(0.5, true);
				return XYZUtilityMethod.IsEqual(xyz, xyz2);
			}
			return false;
		}

		public int GetHashCode(OutWallData obj)
		{
			return obj.Element.UniqueId.GetHashCode();
		}
	}
}
